# 1.导包
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
# 2.打开浏览器（创建浏览器驱动对象）
service = Service(r'F:\python 3.12\chromedriver.exe')
driver = webdriver.Chrome(service=service)
# 3.输入网址
driver.get("http://121.43.169.97:8848/pageA.html")
# 4.页面操作：层级与属性定位
# 用户名
driver.find_element(By.XPATH,"//p[@id='pa']/input[@type='text']").send_keys("admin")
# 密码
driver.find_element(By.XPATH,"//p/input[@type='password']").send_keys("123456")
# 5.等待2秒
time.sleep(90)
# 6.退出浏览器
driver.quit()